<?php
$this->beginBlock('toolbar');
$t = $this->toolbar();
echo $t->renderBegin();
echo $t->renderItem($this->linkButton($this->__('system.button.disable'), "submitGridChecked('grid', '".$this->buildUrl('*/*/*/disable')."')"));
echo $t->renderItem($this->link($this->__('system.button.new'), $this->buildUrl('*/*/*/create')));
echo $t->renderEnd();

$this->nextBlock('grid');
$g = $this->grid('grid', $this->list->toArray())             
			->setSortField($GLOBALS[RC]->getRequest()->getParameter('sort', 'code'))
            ->setSortDirection($GLOBALS[RC]->getRequest()->getParameter('dir', 'asc'));
echo $g->renderBegin();
echo $g->renderHeadBegin();
echo $g->emptyHead()->setStyle('width', '30');
echo $g->htmlHead($this->checkbox()->addClass('row-all-check')->toHtml())->setStyle('width', '30');
echo $g->labelHead($this->__('system.label.code'))->setStyle('width', 100)->setSortField('code')->toHtml();
echo $g->labelHead($this->__('system.label.name'))->setStyle('width', 150)->toHtml();
echo $g->labelHead($this->__('system.label.description'))->toHtml();
echo $g->labelHead($this->__('system.label.status'))->setStyle('width', 100)->toHtml();
echo $g->emptyHead()->setStyle('width', 40);
echo $g->renderHeadEnd();
while($g->nextRow()):
    $currentRow = $g->getCurrentRow();
	echo $g->renderRowBegin();
	echo $g->indexCell()->toHtml();
	echo $g->checkboxCell('{id}', 'ids[]')->addClass('row-check')->toHtml();
	echo $g->labelCell('{code}')->toHtml();
	echo $g->labelCell($this->__($currentRow['name']))->toHtml();
    echo $g->labelCell($this->__($currentRow['description']))->setStyle('text-align', 'left')->toHtml();
	echo $g->statusLabelCell('{status}')->toHtml();
	echo $g->linkCell($this->__('system.button.modify'), $this->buildUrl('*/*/*/edit', array('id'=>'{id}')))
			->setStyle('width', 40)
			->setStyle('text-align', 'center')
			->toHtml();
	echo $g->renderRowEnd();
endwhile;
echo $g->renderEnd();

$this->nextBlock('pagination');
echo $this->pagination($this->recordCount)->toHtml();
$this->endBlock();

echo $this->extend('template'.DS.'list');